﻿using Core;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WordCounter.Core;

namespace WordCounter.Model
{
    /// <summary>
    /// 页面数据模型
    /// </summary>
    public class MainModel : WPFBindingEntity
    {
        private string dir;
        public string Dir
        {
            get => dir;
            set
            {
                dir = value;
                OnPropertyChanged(nameof(Dir));
            }
        }

        private ObservableCollection<FilePageItem> items;
        public ObservableCollection<FilePageItem> Items
        {
            get => items;
            set
            {
                items = value;
                OnPropertyChanged(nameof(Items));
            }
        }

        private long totalPage;
        public long TotalPage
        {
            get => totalPage;
            set
            {
                totalPage = value;
                OnPropertyChanged(nameof(TotalPage));
            }
        }

        private string status;
        public string StatusText
        {
            get => status;
            set
            {
                status = value;
                OnPropertyChanged(nameof(StatusText));
            }
        }

        public MainModel()
        {
            StatusText = "空闲";
            Items = new ObservableCollection<FilePageItem>();
        }
    }

    public class FilePageItem : FileItem
    {
        private long page;
        public long PageCount
        {
            get => page;
            set
            {
                page = value;
                OnPropertyChanged(nameof(PageCount));
            }
        }
    }
}
